package org.neuedu.chapter07_0623.singleton;

public class Singleton {
    private static Singleton s;
    private Singleton(){}
    public static Singleton getInstance() {
        if (s == null) {
            s = new Singleton();
        }
        return s;
    }

    public void test() {
        System.out.println("hello");
    }

    public static void main(String[] args) {
        Singleton s = Singleton.getInstance();
        s.test();
    }
}
